<%@ WebHandler Language="VB" Class="HttpHandlerInside" %>

Imports System
Imports System.Web

Imports MetaSapiens.PageMethods

Public Class HttpHandlerInside
  Implements IHttpHandler
    
  Private _context As HttpContext
  
  Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
    _context = context
    PageMethodsEngine.InvokeMethod(Me, True)
  End Sub
 
  Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
    Get
      Return False
    End Get
  End Property
  
  <PageMethod(True)> _
  Public Sub SampleMethod(ByVal i As Integer)
    _context.Response.ContentType = "text/plain"
    _context.Response.Write("Hello from HTTP handler (code inside). i = " + i.ToString())
  End Sub

End Class